/**
 * FacebookAppConfig.java
 * 
 * Created on Nov 7, 2007 at 9:07:52 PM
 */
package mobiled.bascule.facebook;

import static java.lang.String.format;

/**
 * Configuration information of a Facebook application. 
 * 
 * See your application's page in the <a href="http://www.facebook.com/developers/"> Facebook's Developers Application.</>
 * 
 * @author <a href="alexei.guevara@gmail.com">Alexei Guevara</>
 * @version $Revision:$ updated on $Date:$ by $Author:$
 */
public class FacebookAppConfig {
    
    private static final String LOGIN_URL_PATTERN = "http://www.facebook.com/login.php?api_key=%s&v=1.0";
    private static final String HOME_URL_PATTERN = "http://apps.facebook.com/%s";
    
    private final String myName;
    private final String myApiKey;
    private final String mySecret;
    
    public FacebookAppConfig( String myName, String myApiKey, String mySecret) {
	assert myName != null;
	assert myApiKey != null;
	assert mySecret != null;
	
	this.myName = myName;
	this.myApiKey = myApiKey;
	this.mySecret = mySecret;
    }

    public String getName() {
        return myName;
    }

    public String getApiKey() {
        return myApiKey;
    }

    public String getSecret() {
        return mySecret;
    }
    
    public String getLoginUrl() {
	return format( LOGIN_URL_PATTERN, getApiKey() );
    }
    
    public String getHomeUrl() {
	return format( HOME_URL_PATTERN, getName() );
    }
    

}

